#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int main()
{
    for(int i=123; i<=333; ++i)
    {
        string a, b, c;
        a = to_string(i);
        b = to_string(i*2);
        c = to_string(i*3);
        bool flag = true;
        string mer = a + b + c;
        int cnt[10] = {0};
        for (int j=0; j<9; ++j)
        {
            int tmp = (int)mer[j] - 48;
            ++cnt[tmp];
        }
        if (cnt[0]>0) flag = false;
        for (int j=1; j<=9; ++j)
        {
            if (cnt[j]>1) flag = false;
        }
        if (flag == true) cout << a << " " << b << " " << c << endl;

    }
    return 0;
}
